home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / modnn.nnc < prev    next >
Text File  |  1993-08-23  |  2KB  |  70 lines

  1. csv3.8
  2. !************************************************************************
  3. !*                                    *
  4. !*    Modular Neural Network Control Strategy                *
  5. !*                                    *
  6. !************************************************************************
  7. !
  8. !MASK     label    op-code    operands    comment
  9. L_saR_sa    trace    aux3        !  set trace option to aux3
  10. L_saR_sa    optclr    op:bknc        !  do not BKp to PEs w/o conns
  11. Li_aR_sa    cset    recall,0    !  recall count
  12. !
  13. ! Get input (learn and recall) and desired output (learn only)
  14. !
  15. L_saR_sa    lset    in        !  input layer
  16. L___R_sa    io    read        !  get input data (recall)
  17. L_saR___    io    lrnin        !  get input data (learn)
  18. L_saR_sa    lset    out        !  output layer
  19. L_saR___    io    lrnout        !  get desired output (learn)
  20. L___R_sa    io    rcltst        !  get desired output (test)
  21. !
  22. ! Start with the first layer for a forward pass through network
  23. !
  24. L_saR_sa    lset    in        ! input layer
  25. ! Do summation separately to allow projective layers, and recurrence
  26. L_saR_sa @rloop math    sum|fire
  27. L___R_sa    math    rnoise|tran|output|e=0
  28. L_saR___    math    lnoise|tran|output|e=0|fire
  29. L_saR_sa    lset    cur,1        ! next layer
  30. L_saR_sa    lcmp    out        ! at output layer ?
  31. L_saR_sa    blt    @rloop        ! loop till done
  32. !
  33. ! Compute final outputs
  34. ! Do summation separately to allow for recurrence
  35. !
  36. L_saR_sa     math    sum|fire
  37. L___R_sa    math    rnoise|tran|output|fire
  38. L_saR___    math    lnoise|tran|output|fire
  39. !
  40. ! Output
  41. !
  42. L___R_sa    io    write        ! recall
  43. L_saR___    io    lrnrslt        ! learn
  44. !
  45. ! Back-propagate the desired output
  46. !
  47. L_saR___    math    backp|fire    ! learn
  48. L_saR___    lset    out,-1        ! gate layer
  49. ! Calculating posterior probabilities, modified errors,
  50. ! and back-propagate
  51. L_saR___    math    e-=w|fire    !  
  52. L_saR___    math    backp|fire    ! 
  53. !
  54. ! Learn cycle - back propagate error.  Store unscaled error in
  55. ! current error field.
  56. !
  57. L_saR___    lset    out,-2        ! last local output layer
  58. L_saR___ @lloop    math    ce=e|e*=f'|backp|fire
  59. L_saR___     math    learn|fire    ! delayed learning for recurrence
  60. L_saR___    lset    cur,-1        ! previous layer
  61. L_saR___    lcmp    in        ! at input layer ?
  62. L_saR___    bgt    @lloop        ! loop till done
  63. !
  64. ! Set up current error for instruments
  65. !
  66. L_saR_sa    lset    out        !  Output layer
  67. L_saR_sa    math    ce=e|e-=w|swap|fire
  68.  
  69. LisaRisa    trace    0        ! turn off any trace function
  70.